home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / Abacus diskdrives IO.adf / CH4 / Program1.bas < prev    next >
BASIC Source File  |  1978-06-28  |  623b  |  37 lines

  1. 'Program 1:
  2.  
  3. more:
  4. INPUT "(R)ead next, (I)nput, (E)nd"; action$
  5. IF action$="r" THEN DataReader
  6. IF action$="i" THEN DataEntry
  7. IF action$="e" THEN END
  8. GOTO more
  9.  
  10. DataEntry:
  11. CLOSE #1:
  12. count=0
  13. OPEN "example-file" FOR APPEND AS #1
  14. INPUT "Name";Person$
  15. INPUT "Street";Street$
  16. INPUT "City";City$
  17. PRINT #1,Person$
  18. PRINT #1,Street$
  19. PRINT #1,City$
  20. CLOSE #1
  21. GOTO more
  22.  
  23. DataReader:
  24. IF count=0 THEN OPEN "example-file" FOR INPUT AS #1:count =1
  25.  
  26.  
  27. IF EOF(1)<>0  THEN PRINT "No additional data records!": GOTO more
  28.  
  29. INPUT #1,Person$
  30. INPUT #1,Street$
  31. INPUT #1,City$
  32. PRINT "Name",Person$
  33. PRINT "Street",Street$
  34. PRINT "City",City$
  35. GOTO more
  36.  
  37.